package com.jackie.easyble.ui.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.DataBindingHolder
import com.jackie.easyble.R
import com.jackie.easyble.databinding.AdapterStringListRecylerViewBinding

class StringListRecyclerViewAdapter :
    BaseQuickAdapter<String, StringListRecyclerViewAdapter.ViewHolder>() {

    class ViewHolder(resId: Int, parent: ViewGroup) :
        DataBindingHolder<AdapterStringListRecylerViewBinding>(resId, parent)


    override fun onBindViewHolder(holder: ViewHolder, position: Int, item: String?) {
        holder.binding.textTv.text = item
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        return ViewHolder(
            R.layout.adapter_string_list_recyler_view,
            parent
        )
    }

}